package com.mew.slots.core.game.mymg;

import com.mew.common.rest.bo.GameSession;
import com.mew.slots.core.common.handler.AbstractBetHandler;
import com.mew.slots.core.common.handler.SlotsHandler;
import com.mew.slots.core.common.messge.response.SlotsBonusPlayResponseMessage;
import com.mew.slots.core.common.messge.response.SlotsPlayResponseMessage;
import com.mew.slots.core.common.utils.SlotsGameUtil;
import com.mew.slots.core.common.vo.StrategyGameVO;
import com.mew.slots.core.game.jg.roller.JgXml;
import com.mew.slots.core.game.jg.service.JgService;
import com.mew.slots.core.game.mymg.roller.MymgIli;
import com.mew.slots.core.game.mymg.roller.MymgXml;
import com.mew.slots.core.game.mymg.service.MymgBonusService;
import com.mew.slots.core.game.mymg.service.MymgService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

/**
 * @Author King.Song
 * @Date 2020/11/9 0009
 **/
@Service
@SlotsHandler(value = "MYMG")
@Slf4j
public class MymgHandler extends AbstractBetHandler {

    private MymgService service = new MymgService();
    private MymgBonusService bonusService = new MymgBonusService();

    @Override
    public void specialCheck(StrategyGameVO gameVO, GameSession userVO) {}

    @Override
    public SlotsPlayResponseMessage play(StrategyGameVO gameVO, GameSession userVO) {

        return service.Ready(gameVO);
    }

    @Override
    public SlotsBonusPlayResponseMessage playBonus(StrategyGameVO gameVO, GameSession userVO) {
        return bonusService.play(gameVO);
    }

    @Override
    public void readRoller() throws Exception{
        MymgIli.getInstance().init();
    }

    public static void main(String[] args) throws Exception {
        MymgHandler handler=new MymgHandler();
        handler.readRoller();
        StrategyGameVO vo = SlotsGameUtil.buildTestStrategyGameVO();
        vo.setLineNumber(50);
        System.out.println(handler.play(vo,null));
    }
}
